#!/bin/bash

force="$(echo $* | grep -o '\b-f\b')"
if [ -z "$force" ]; then
  unset force
fi
editor="$(echo $EDITOR | replace '-f' '')"
if [ -z "`which $editor`" ]; then editor="gvim"; fi
if [ -z "`which $editor`" ]; then editor="mvim"; fi
if [ -z "`which $editor`" ]; then editor="vim"; fi
if [ -z "`which $editor`" ]; then editor="vi"; fi
if [ -z "`which $editor`" ]; then exit 1; fi

# cat <<EOF
# $editor $force $*
# EOF
exec $editor $force $*

